﻿// owner 蒋家伟

#pragma once
#include "IDeviceManager.h"
#include "IDevice.h"

namespace jsdk
{
    class DeviceManager : public IDeviceManager
    {
    public:
        static DeviceManager* getFW();
        static const DeviceManager* get();
        DeviceManager() {};
        ~DeviceManager();
        bool registerDevice(OwnerPtr<IDevice> opDevice);
        void start();
        void stop();

    private:
        virtual const IDevice* getDeviceByName(const std::wstring& deviceName) const override;
        virtual IDevice* getDeviceFWByName(const std::wstring& deviceName) override;
    protected:
        std::map<std::wstring, OwnerPtr<IDevice>> m_deviceClassToDevice;
    };
}